# coding:utf-8
# *******************************************************************
# * Copyright 2021-2080 evilbinary
# * 作者: evilbinary on 01/01/20
# * 邮箱: rootdebug@163.com
# ********************************************************************
import os
nasm_env = Environment(tools = ['nasm'],
                  AS='`which nasm`',
                  ASFLAGS='',
                  OBJSUFFIX=''
                  )

# print dir(env)
nasm_env.StaticObject('boot', ['boot.s'],ASFLAGS='-f bin')
# nasm_env.StaticObject('init.o', 'init.s',ASFLAGS="-f elf32")



Import('env')               

env.GenerateKernelSize('config.h',['../../app/kernel'])
env.Program('init.elf', 
    ['init.c',],
    CFLAGS='$CFLAGS -I. -Iinclude  -Iarch -std=c99 -std=gnu99 -w ',
    LINKFLAGS= '$LINKFLAGS -Ttext 0x0500')

env.Objcopy('init.bin','init.elf',OBJCOPYFLAGS='-j .text -O binary -S')